package com.caesar.innerclass;

/**
 * @author caesar
 * @date 2025/7/13
 * @Description:
 * @apiNote
 */
public class Goods implements Comparable {

    public static void main(String[] args) {

    }
    private int id;
    private String name;
    private double price;
    private int salesVolume;
    private double favorableRate;

    public Goods() {
    }

    public Goods(int id, String name, double price, int salesVolume, double favorableRate) {
        this.id = id;
        this.name = name;
        this.price = price;
        this.salesVolume = salesVolume;
        this.favorableRate = favorableRate;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public int getSalesVolume() {
        return salesVolume;
    }

    public void setSalesVolume(int salesVolume) {
        this.salesVolume = salesVolume;
    }

    public double getFavorableRate() {
        return favorableRate;
    }

    public void setFavorableRate(double favorableRate) {
        this.favorableRate = favorableRate;
    }

    @Override
    public String toString() {
        return "Goods{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", salesVolume=" + salesVolume +
                ", favorableRate=" + favorableRate +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        Goods goods = (Goods) o;
        return this.id - goods.id;
    }
}
